{% extends "main.html" %}

{% load common %}

{% block title %}Repositories {{ repo }} {% endblock %}

{% block content_title %}Repository Information{% endblock %}

{% block breadcrumbs %}{{ block.super }} &rsaquo; <a href="{% url 'repo_list' %}">Repositories</a> &rsaquo; {{ repo }} {% endblock %}

{% block content %}

<div class="module">
    <h2>{{ repo }} Details</h2>
    <table>
        <tr><td>Name</td><td> {{ repo.name }} </td></tr>
        <tr><td>Type</td><td> {{ repo.get_repotype_display }} </td></tr>
        <tr><td>Architecture</td><td> {{ repo.arch }} </td></tr>
        <tr><td>Security</td><td> {% yes_no_img repo.security 'False' 'Security' 'Not Security' %} </td></tr>
        <tr><td>Enabled</td><td> {% yes_no_img repo.enabled 'False' 'Enabled' 'Not Enabled' %} </td></tr>
        <tr><td>Mirrors</td><td> {{ repo.mirror_set.count }} </td></tr>
    </table>
</div>
{% if user.is_authenticated %}
  {% if perms.is_admin %}
  <div class="module">
    <h2>Delete Confirmation</h2>
    <div class="dialog">
    Are you sure you want to mark this repository as
    {% if enable %}
      security?
    {% else %}
      non-security?
    {% endif %}
      <form action="." method="POST">
        {% csrf_token %}
        {% if enable %}
          <input name="enablesec" type="submit" value="Yes" />
        {% else %}
          <input name="disablesec" type="submit" value="Yes" />
        {% endif %}
        <input name="cancel" type="submit" value="Cancel" />
      </form>
    </div>
  </div>
  {% else %}
  <div class="module">
    <h2>Insufficient Permissions</h2>
    <div class="brick">
    You do not have sufficient permissions to modify this repository.
    </div>
  </div>
  {% endif %}
{% endif %}
<div class="module">
  <h2>Mirrors</h2>
  {% gen_table repo.mirror_set.all %}
</div>
<div class="module">
  <h2>Hosts with this Repository</h2>
  {% gen_table repo.host_set.all %}
</div>
<div class="module">
  <h2>OS Groups with this Repository</h2>
  {% gen_table repo.osgroup_set.all.distinct %}
</div>


{% endblock %}

